Repository navigation
Player order for games that read every controller - #37
Merged
Merged
Conversation
Controllers -> 'Player order' picks which slot plays as player 1-4 in games that read every controller (no controller chosen for the game), for local co-op where Windows numbered the controllers differently. Sent with the tuning message (hook protocol 5); the hook remaps the game's XInput user indexes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before: in local co-op games the controllers got the player numbers Windows gave them, so "player 2 controls player 1" could only be fixed by reconnecting controllers in the right order.
After: Controllers → "Sticks, triggers and buttons" → "Player order" picks which slot plays as player 1, 2, 3 and 4. It applies to games that read every controller (no single controller chosen for the game). Picking a slot that another player had swaps the two.
How:
gamepadTuning.playerOrder(defaults to Windows' order). It travels in the existing tuning message, whose spare bytes now carryplayerSlots(hook protocol 5, same size). Without slot lock, the hook'sMapUserIndexmaps the game's user index through that order; keystrokes report the index the game asked for. Not yet tried on real Windows.